﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.ComponentModel;

namespace Nightwish.Controls.Tree.NodeControls
{
	public class NodeIconCallBack : NodeIcon
	{
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public Func<object, TreeViewAdvEventArgs, Image> GetIconImage;
		
		internal Image OnGetIconImage(TreeNodeAdv node)
		{
			if (GetIconImage != null)
				return GetIconImage(this, new TreeViewAdvEventArgs(node));
			return null;
		}

		protected override Image GetIcon(TreeNodeAdv node)
		{
			return OnGetIconImage(node);
		}
	}
}
